//
//  PopupView.m
//  LewPopupViewController
//
//  Created by deng on 15/3/5.
//  Copyright (c) 2015年 pljhonglu. All rights reserved.
//

#import "PopupView.h"
#import "UIViewController+LewPopupViewController.h"
#import "LewPopupViewAnimationFade.h"
#import "JTPassengerTrip.h"
#import "JTUser.h"
@interface PopupView ()
@property (weak, nonatomic) IBOutlet UIImageView *headImage;
@property (weak, nonatomic) IBOutlet UILabel *nickName;
@property (weak, nonatomic) IBOutlet UILabel *byCurrent;
@property (weak, nonatomic) IBOutlet UILabel *start;
@property (weak, nonatomic) IBOutlet UILabel *end;
@property (weak, nonatomic) IBOutlet UILabel *goDate;
@property (weak, nonatomic) IBOutlet UILabel *goTime;
@property (weak, nonatomic) IBOutlet UILabel *remark;

@end

@implementation PopupView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        [[NSBundle mainBundle] loadNibNamed:[[self class] description] owner:self options:nil];
        _innerView.frame = frame;
        [self addSubview:_innerView];
    }
    return self;
}


+ (instancetype)defaultPopupView{
    return [[PopupView alloc]initWithFrame:CGRectMake(0, 0, 250, 283)];
}

-(void)setPass:(JTPassengerTrip *)pass
{   _pass =pass;
    _start.text =_pass.start;
    _end.text =_pass.end;
    JTUser * user =_pass.passenger;
    _headImage.image =[UIImage imageWithData:user.icon];
    _headImage.layer.cornerRadius =_headImage.frame.size.width/2;
    _headImage.layer.masksToBounds = YES;
    _nickName.text = user.nickname;
    _goDate.text =[NSString stringWithFormat:@"预约出发日期：%@",_pass.time];
    _goTime.text =[NSString stringWithFormat:@"预约出发时间：%@",_pass.timeInterval];
    _remark.text = _pass.remark;
    _remark.numberOfLines =0;
    [_remark sizeToFit];
    _byCurrent.text = [NSString stringWithFormat:@"拼车次数：%@次",user.current];
}




@end
// 版权属于原作者
// http://code4app.com (cn) http://code4app.net (en)
// 发布代码于最专业的源码分享网站: Code4App.com